import java.util.Scanner;


class PackingForHoliday {
	public static void main(String[] args) {

	      Scanner scanner = new Scanner(System.in);

	      int n = scanner.nextInt() ;
	      
	      for(int i=0;i<n;i++)
	      {
	    	  int l,b,h ;
	    	  l = scanner.nextInt();
	    	  b = scanner.nextInt();
	    	  h = scanner.nextInt();
	    	  
	    	  if(l<=20 && b<=20 && h<=20)
	    	  {
	    		  System.out.println("Case "+(i+1)+": good") ;
	    	  }
	    	  else System.out.println("Case "+(i+1)+": bad") ;
	      }
	      // close the scanner
	      scanner.close();
	   }
}
